/*
 * @version: vue3
 * @Author: lxs
 * @Date: 2022-05-01 12:42:11
 * @LastEditors: sueRimn
 * @LastEditTime: 2022-05-01 12:51:10
 */
enum keys {
  token = "token",
  userId = "userID",
  ExpireTime = "expireTime",
}
export const setToken = (token: string) => {
  sessionStorage.setItem(keys.token, token);
};

export const getToken = () => {
  sessionStorage.getItem(keys.token);
};

export const setUserId = (userId: number) => {
  sessionStorage.setItem(keys.userId, JSON.stringify(userId));
};

export const getUserId = () => {
  sessionStorage.getItem(keys.userId);
};

export const setExpireTime = (time: number) => {
  sessionStorage.setItem(keys.ExpireTime, JSON.stringify(time));
};
export const getExpireTime = () => {
  return sessionStorage.getItem(keys.ExpireTime);
};
